#include<string>
#include<stdio.h>
#include<iostream>
#include<map>

int main(){
    std::map<int, std::string> person;
    person.insert(std::pair<int, std::string>(001, "Liang Aokai"));
    person.insert(std::map<int, std::string>::value_type(002, "Liang Yan"));
    person[003] = "Xiao Ming";
    std::cout << person.size() << std::endl;
    std::pair<std::map<int, std::string>::iterator, bool> Insert_Pair;
    Insert_Pair = person.insert(std::map<int, std::string>::value_type(001, "Xiao Mi"));
    if(!Insert_Pair.second){
        std::cout << "Error insert new element" << std::endl;
    }
    std::map<int, std::string>::iterator it = person.begin();
    std::map<int, std::string>::reverse_iterator re_it = person.rbegin();
    while (it != person.end())
    {
        std::cout << "key is: " << it->first << "value is: " << it->second << std::endl;
        it++;
    }

    while (re_it != person.rend())
    {
        std::cout << "key is: " << re_it->first << "value is: " << re_it->second << std::endl;
        re_it++;
    }

    std::string str = "Hello world";
    std::string str2 = "Hello World";
    std::string str3 = "7orld";
    std::size_t loc = str.find(str3);
    if(loc != std::string::npos){
        std::cout << "the location is " << loc << std::endl;
    }
    std::string integ = "1234";
    int a = std::stoi(integ);
    if(str.compare(str2) == 0){
        printf("is same");
    }else{
        printf("not same");
    }
}